{{useCss "app-pages/css/goods_list.scss"}}
<div class="mainindex">
    <div class="goods-type">
        <div id="left">
            <!-- 每页显示12个商品 -->
            <h1>{{$Cache.goods_list.typename}}</h1>
            <div class="goods">
                {{#each $Cache.goods_list.goods}}
                    <main-goods-pc 
                        src="{{preview_img_url}}?imageView/1/w/200/h/200"
                        href="/goods_details/details.html?id={{_id}}"
                        intro="{{intro}}"
                        name="{{goods_name}}"
                        price="{{price}}"
                        count="{{num}}"
                        sale="{{sale_num}}"
                    ></main-goods-pc>
                {{/each}}
            </div>

            <!-- 翻页 -->
            <div id="page_turn">
                <div id="pre_page">
                    {{#if $Cache.goods_list.current_page_num!=0}}
                    <href title="前一页" to="/goods_list.html?id={{$Top.$Cahce.goods_list.type}}&page={{$Cache.goods_list.current_page_num-1}}&num={{$Cache.goods_list.goods_pre_num}}"><i name="pre_page" class="icon-arrow-left"></i></href>
                    {{/if}}
                </div>

                <div id="page_num">
                    {{#each $Cache.goods_list.page_num}} {{#if $Index==$Top.$Cache.goods_list.current_page_num}} [当前页：{{~~$Index+1}}] {{#else}}
                    <href to="/goods_list.html?id={{$Top.$Cahce.goods_list.type}}&page={{$Index}}&num={{$Top.$Cache.goods_list.goods_pre_num}}">
                        <span>{{~~$Index+1}}</span>
                    </href>
                    {{/if}} {{/each}}
                </div>

                <div id="next_page">
                    {{#if $Cache.goods_list.page_num.length>$Cache.goods_list.current_page_num+1}}
                    <href title="后一页" to="/goods_list.html?id={{$Top.$Cahce.goods_list.type}}&page={{$Cache.goods_list.current_page_num+1}}&num={{$Cache.goods_list.goods_pre_num}}"><i name="next_page" class="icon-arrow-right"></i></href>
                    {{/if}}
                </div>
            </div>

        </div>

    </div>

</div>
